﻿using System.ComponentModel.DataAnnotations;

namespace BBCore.Application.ViewModels.Admins
{
    /// <summary>
    /// 更改密码
    /// </summary>
    public class ChangePasswordVo
    {
        [Required(ErrorMessage = "旧密码不能为空")]
        [DataType(DataType.Password)]
        [Display(Name = "当前密码:")]
        public string? OldPassword { get; set; }

        [Required(ErrorMessage = "新密码不能为空")]
        [StringLength(maximumLength: 15, MinimumLength = 3,ErrorMessage ="密码长度不能低于3位")]
        [DataType(DataType.Password)]
        [Display(Name = "新密码：")]
        public string? NewPassword { get; set; }

        [Required(ErrorMessage = "新密码确认不能为空")]
        [StringLength(maximumLength: 15, MinimumLength = 3, ErrorMessage = "密码长度不能低于3位")]
        [DataType(DataType.Password)]
        [Display(Name = "确认新密码:")]
        [Compare("NewPassword", ErrorMessage = "新密码和确认密码不匹配。")]
        public string? RePassword { get; set; }
    }
}
